﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ITAP.ContourBuilder.GUI
{
    public enum ConnectorOffsetType
    {
        Left,
        Right, 
        Up,
        Down
    }

    public partial class FormMoveConnectorsWithOffset : Form
    {
        public ConnectorOffsetType OffsetType
        {
            get
            {
                switch(comboBoxOffsetDirection.SelectedIndex)
                {
                    case 0:
                        return ConnectorOffsetType.Left;
                    case 1:
                        return ConnectorOffsetType.Right;
                    case 2:
                        return ConnectorOffsetType.Up;
                    case 3:
                        return ConnectorOffsetType.Down;
                }
                return ConnectorOffsetType.Left;
            }
        }

        public double OffsetValue
        {
            get
            {
                return (double)numericUpDownOffsetValue.Value;
            }
        }

        public FormMoveConnectorsWithOffset()
        {
            InitializeComponent();
            comboBoxOffsetDirection.Items.Add("Влево");
            comboBoxOffsetDirection.Items.Add("Вправо");
            comboBoxOffsetDirection.Items.Add("Вверх");
            comboBoxOffsetDirection.Items.Add("Вниз");
            comboBoxOffsetDirection.SelectedIndex = 0;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
